package cn.jiyun.controller;

import cn.jiyun.pojo.PassengerChargingItems;
import cn.jiyun.service.PassengerChargingItemsService;
import cn.jiyun.vo.ResultCommon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/pas")
@CrossOrigin
public class PassengerChargingItemsController {
    @Autowired
    private PassengerChargingItemsService passengerChargingItemsService;
    @RequestMapping("/findAll")
    public ResultCommon findAll(){
        List<PassengerChargingItems> passengerChargingItems = passengerChargingItemsService.findAll();
        return ResultCommon.suceessData(passengerChargingItems);
    }
    @PostMapping("/updatebyid")
    public ResultCommon updatebyid(@RequestBody PassengerChargingItems passengerChargingItems){
        passengerChargingItemsService.updateById(passengerChargingItems);
        return ResultCommon.suceess();
    }
}
